# import the necessary modules
import numpy as np
import matplotlib.pyplot as plt
# for numerical inegration
import scipy.integrate
# for pretty plots
import seaborn as sns
sns.set()
# extra packages for interactive plots
import holoviews as hv
import bokeh.io
import panel as pn
bokeh.io.output_notebook()
pn.extension('mathjax')
hv.extension('bokeh')
sns.set(font_scale = 1.5, rc={"lines.linewidth":2})
Problem 1: Uploaded on a separate file
Problem 2:
2a.)
x = np.linspace(0,5,100)
r = 2
h = 1
a = 2
k = .5
N = np.linspace(-10,10,100)
eq1 = r*N*(1-(N/k))-h*(N/(a+N))
plt.plot(n,y2)
plt.axhline(y=0, color = 'grey')
plt.axvline(x=0, color = 'grey')
<matplotlib.lines.Line2D at 0x7f8a48ff7a30>
My graph does not look right but from the looks of it, I feel as if this model is better due to it's show casing of the direction the fisheries would be headed if there was no regulations.
2b.)
fig, (ax1, ax2, ax3) = plt.subplots(1,3, figsize =[32,8])
x = np.linspace(0,1,100)
y2 = x*(1-x)
h = .25
a = .1
y1 = h*(x/(a+x))
ax1.plot(x,y1)
ax1.plot(x,y2)
ax1.axhline(y=0, color = 'grey')
ax1.axvline(x=0, color = 'grey')
h = .4
a = .5
y1 = h*(x/(a+x))
ax2.plot(x,y1)
ax2.plot(x,y2)
ax2.axhline(y=0, color = 'grey')
ax2.axvline(x=0, color = 'grey')
h = 1
a = .75
y1 = h*(x/(a+x))
ax3.plot(x,y1)
ax3.plot(x,y2)
ax3.axhline(y=0, color = 'grey')
ax3.axvline(x=0, color = 'grey')
<matplotlib.lines.Line2D at 0x7f8a4919aca0>
The first graph has 3 fixed points at 0, .22, and .68. It is stable at .22 and 0. It is unstable at .68.
The second graph has 2 fixed points at 0 and .68. It is stable at 0. It is unstable at .68.
The third graph has 1 fixed point at 0. It is stable at 0.
2c.)
2d.)
I would recommend that they set a particular boundary that they are not allowed to cross. If set boundary is crossed, it could result in a rapid decline of fish ending in a possible extinction.
Problem 3:
3a.
N = how cooperative the transcriptive binding is
beta = transcription rate
gamma = degradation rate
3b.
x = np.linspace(-0.01,5,100)
gamma = 0.2
beta = 1
k_x = 1.5
n = 1
production = ( beta / ((k_x/x)**n + 1))
degradation = gamma * x
plt.plot(x,production, label = 'production')
plt.plot(x,degradation, label = 'degradation')
plt.axhline(y=0, color = 'grey')
plt.axvline(x=0, color = 'grey')
<matplotlib.lines.Line2D at 0x7f8a48e91490>
x = np.linspace(0,20,100)
gamma = .5
beta = .5
k_x = 1.6
n = 1
production = ( beta / ((k_x/x)**n + 1))
degradation = gamma * x
plt.plot(x,production, label = 'production')
plt.plot(x,degradation, label = 'degradation')
plt.axhline(y=0, color = 'grey')
plt.axvline(x=0, color = 'grey')
plt.ylim([0,5])
/var/folders/j9/jj9vrj3168xd_tgf8nym50c40000gn/T/ipykernel_27236/639346014.py:8: RuntimeWarning: divide by zero encountered in true_divide production = ( beta / ((k_x/x)**n + 1))
(0.0, 5.0)
Biologically, the reason there is only one fixed point on this graph is because the transcription rate has decreased.
3c.
x = np.linspace(-0.01,5,100)
gamma = 0.2
beta = 1
k_x = 1.5
n = 2
production = ( beta / ((k_x/x)**n + 1))
degradation = gamma * x
plt.plot(x,production, label = 'production')
plt.plot(x,degradation, label = 'degradation')
plt.axhline(y=0, color = 'grey')
plt.axvline(x=0, color = 'grey')
<matplotlib.lines.Line2D at 0x7f8a49026ca0>
There is a total of 3 fixed points. Fixed points, 0 and .5, are stable. Fixed point 4.5 is unstable. Productive coopertivity is required for bistability due to the undualtioin of the graph. At a positive point increasing acorss the graph it can allow for the graph to remain stable.
3d.)
Repression is secified in these cases due to the location of the x and y on their respective system. As beta y is being divided by a fraction of x the fraction is limited by ky that regulates the repressor. This occurs vice versa as well.
3e.)
x = np.linspace(-0.01,5,100)
y = np.linspace(-0.01,5,100)
gamma = 0.2
beta = 1
k_x = 1.5
k_y = 1.5
n = 1
null_x = ( beta / (((y/k_x)**n + 1)* gamma))
null_y = ( beta / (((x/k_y)**n + 1)* gamma))
plt.plot(null_x,y, label = 'nullcline x')
plt.plot(x,null_y, label = 'nullcline y')
plt.axhline(y=0, color = 'grey')
plt.axvline(x=0, color = 'grey')
<matplotlib.lines.Line2D at 0x7f8a48dd4ca0>
There is one fixed point at roughly 2 on the x axis.
3f).
x = np.linspace(-0.01,5,100)
y = np.linspace(-0.01,5,100)
gamma = 0.2
beta = 1
k_x = 1.5
k_y = 1.5
n = 2
null_x = ( beta / (((y/k_x)**n + 1)* gamma))
null_y = ( beta / (((x/k_y)**n + 1)* gamma))
plt.plot(null_x,y, label = 'nullcline x')
plt.plot(x,null_y, label = 'nullcline y')
plt.axhline(y=0, color = 'grey')
plt.axvline(x=0, color = 'grey')
<matplotlib.lines.Line2D at 0x7f8a284b5130>
There are 3 fixed points on this graph. As we can see, .5, 1.9, and 4.5 are all fixed points along the graph. Fixed points, .5 and 1.9 are both unstable and 4.5 is stable. Overtime the graph would continue to decrease and eventually fall below the x axis. It appears that the two genes follow along the same trend and can be present at the same time.